﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BoAddonBiz_FreightForwarder.BusinessBase;
using SAPbouiCOM;

namespace BoAddonBiz_FreightForwarder.Other
{
    [ControlB1Form(IsNew = true, FormType = B1FormTypes.ado_AVA_OR_BusinessOperation)]
    class B1Form_BusinessOperation_Other : B1Form_BusinessOperation_Base
    {
        #region override
        protected override string AVA_OBNO { get { return "@AVA_OR_OBNO"; } }
        protected override string AVA_BNO1 { get { return "@AVA_OR_BNO1"; } }
        protected override string AVA_BNO2 { get { return "@AVA_OR_BNO2"; } }
        protected override string AVA_BNO3 { get { return "@AVA_OR_BNO3"; } }
        protected override string AVA_BNO4 { get { return "@AVA_OR_BNO4"; } }
        protected override string AVA_BNO5 { get { return "@AVA_OR_BNO5"; } }
        protected override string AVA_ODLG { get { return "@"; } }
        protected override string AVA_DLG1 { get { return "@"; } }
        protected override string AVA_DLG2 { get { return "@"; } }
        protected override string AVA_DLG3 { get { return "@"; } }
        protected override string AVA_DLG6 { get { return "@"; } }
        protected override string AVA_AirOrder { get { return ""; } }
        protected override string AVA_AirOrderUsed { get { return ""; } }
        protected override string AVA_OAOU { get { return "@"; } }
        protected override string AVA_OAOD { get { return "@"; } }
        protected override string SourceObject { get { return ""; } }
        protected override string BusinessType { get { return "OR"; } }
        protected override string[] SumMapping
        {
            get { return new string[] { "U_Quantity:U_Quantity", "U_GrossWeight:U_GrossWeight", "U_BillingWeight:U_BillingWeight", "U_Volume:U_Volume", "U_CargoValue:U_CargoValue" }; }
        }
        protected override string[] CB_LABEL_UDS_DBDS_OBJECT_TABLE_DESC
        {
            get
            {
                return new string[] {
            "cb_opup:btn_opup:OPUP_UID:U_IsPickup:AVA_OR_Pickup:@AVA_OR_OPUP:提货",
            "cb_oisu:btn_oisu:OISU_UID:U_IsInsure:AVA_OR_Insure:@AVA_OR_OISU:投保",
            "cb_oatc:btn_oact:OATC_UID:U_IsCustoms:AVA_OR_ApplyCustoms:@AVA_OR_OATC/@AVA_OR_ATC1:出口报关/报检",
            "cb_ostg:btn_ostg:OSTG_UID:U_IsWarehouse:AVA_OR_Storage:@AVA_OR_OSTG/@AVA_OR_STG1:仓储",
            "cb_odlv:btn_odlv:ODLV_UID:U_IsDelivery:AVA_OR_Deliver:@AVA_OR_ODLV:送货",
            "cb_octc:btn_octc:OCTC_UID:U_IsClearance:AVA_OR_Clearance:@AVA_OR_OCTC/@AVA_OR_CTC1:进口报关/报检",
            "cb_oarp:btn_oarp:OARP_UID:U_IsArrivePort:AVA_OR_ArrivePort:@AVA_OR_OARP:到港"
            };
            }
        }
        #endregion
        #region constractor
        public B1Form_BusinessOperation_Other()
            : base()
        {
            this.frm_ItemEvent += new SAPBoAddon.IB1FormEvents.B1ItemEventEventHandler(B1Form_BusinessOperation_Air_frm_ItemEvent);
        }
        #endregion
        #region protected override
        protected override void FormInfoSetting(SAPBoAddon.B1FormSetting FormSetting)
        {
            FormSetting.FormType = B1FormTypes.ado_AVA_OR_BusinessOperation;
            FormSetting.FormFileName = "AVA_OR_BusinessOperaForm.srf";
            #region 窗体控件控制
            string[] NewModeItms = new string[] { "274", "275", "277", "278", "279", "276", "268", "269", "270", "271", "272", "273" };
            #region 添加状态
            FormSetting.FormModeSetting.itmNewModeEnable = Utils.GetFormItems(FormSetting.FormXmlDocument, true, NewModeItms);
            FormSetting.FormModeSetting.itmNewModeDisable = NewModeItms;
            #endregion
            #endregion
            base.FormInfoSetting(FormSetting);
        }

        /// <summary>
        /// 初始化
        /// </summary>
        /// <author>WangPeng</author>
        protected override void InitializeForm(SAPBoAddon.B1FormInitializePar InitPar)
        {
            base.InitializeForm(InitPar);
            Utils.InitialItemComboBox(this.SBOCompany, this.CurrentForm.Items.Item("cargo_72"), "Code", "Name", "@AVA_FF_BAMD", "Code", null, null, true);//成交方式 by WangPeng 2012年9月14日 13:17:19
        }
        #endregion
        #region events
        void B1Form_BusinessOperation_Air_frm_ItemEvent(SAPBoAddon.B1AddonBase.B1ItemEvent pVal, ref bool BubbleEvent)
        {
            if (pVal.Before_Action)
            {
            }
            else
            {
                if (pVal.ItemUID == "tab_0" && pVal.EventType == BoEventTypes.et_ITEM_PRESSED)
                {
                    CurrentForm.PaneLevel = 1;
                }
                if (pVal.ItemUID == "tab_1" && pVal.EventType == BoEventTypes.et_ITEM_PRESSED)
                {
                    CurrentForm.PaneLevel = 2;
                }
                if (pVal.ItemUID == "tab_2" && pVal.EventType == BoEventTypes.et_ITEM_PRESSED)
                {
                    CurrentForm.PaneLevel = 3;
                }
                if (pVal.ItemUID == "tab_3" && pVal.EventType == BoEventTypes.et_ITEM_PRESSED)
                {
                    CurrentForm.PaneLevel = 4;
                }
                if (pVal.ItemUID == "tab_4" && pVal.EventType == BoEventTypes.et_ITEM_PRESSED)
                {
                    CurrentForm.PaneLevel = 5;
                }
            }
        }

        #endregion
    }
}
